package com.myblog.config.security;

import com.myblog.config.security.handle.CustomSessionInformationExpiredStrategy;
import com.myblog.service.SmsSend;
import com.myblog.service.impl.SmsDefaultSendImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;

@Configuration
public class SecurityCpnfigBean {



    @Bean
    @ConditionalOnMissingBean(SmsSend.class)
    public SmsSend smsSend(){
        return new SmsDefaultSendImpl();
    }


    /**
     * 多用户登录的默认处理
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(SessionInformationExpiredStrategy.class)
    public SessionInformationExpiredStrategy sessionInformationExpiredStrategy(){
        return new CustomSessionInformationExpiredStrategy();
    }

}
